package behavioral_pattern.command_pattern.test2;

import java.io.Serializable;

/**
 * 抽象命令类，
 */
public abstract class Command implements Serializable {
   protected String name; //命令名称
   protected String args; //命令参数

    public Command(String name) {
        this.name = name;
    }

    protected Configurator configurator;//维持对接收者对象的引用

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setConfigurator(Configurator configurator) {
        this.configurator = configurator;
    }

    //声明两个抽象的执行方法
    public abstract void execute(String args);
    public abstract void execute();
}
